package com.yiji.fintech.musfinance.common.enginerules.rules;

import com.yiji.fintech.musfinance.common.annotation.RuleNameAnnotation;
import com.yiji.fintech.musfinance.common.enginerules.base.RulesFilter;
import com.yiji.fintech.musfinance.common.domain.channel.ChannelDomain;
import org.springframework.stereotype.Service;

import java.util.stream.Collectors;

/**笔限规则
 * Created by ouwen@yiji.com} on 2017/9/20.
 */
@Service
@RuleNameAnnotation("笔限规则服务")
public class QuotaRuleService extends RulesFilter {
    @Override
    protected void filter(ChannelDomain domain) {
        channelApiList =  channelApiList.stream().filter((s)->s.getQuota().compareTo(domain.getAmount()) > 0).collect(Collectors.toList());
    }
}
